#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int numJewelsInStones(string jewels, string stones)
    {
        vector<int> hash(127);
        for (auto e : jewels) hash[e]++;

        int ret = 0;
        for (auto e : stones)
            if (hash[e]) ret++;
        return ret;
    }
};